﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Browse_ProvenanceByAgency : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //Calls the Stored Procedure to Return all of the Names and Variant Names filters on XREF 
        //which is hard coded in the stored procedure to the Qualifier Id.

        PublicCatalogDataContext db = new PublicCatalogDataContext();
        {
            var myProvenance = db.PUB_GetProvenanceXREFFilterNamesVariants();

            //If the stored procedure doesn't return any data then the error message below is displayed.
            if (myProvenance != null)
            {
                Repeater1.DataSource = myProvenance;
                Repeater1.DataBind();
            }
            else
            {
                Label1.Text = "Error: No data found please try again later.";
                Label1.Visible = true;
            }
        }
    }

}
